﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.Entity;
using Orange.Mvc4App.Models;

namespace Orange.Mvc4App.Infrastructure {
    public class OrangeInitializer : IDatabaseInitializer<OrangeContext> {
        public void InitializeDatabase(OrangeContext context) {

            var customers = new List<Customer>() { 
                    new Customer{ CustomerId=1,CustomerName="A"},
                    new Customer{CustomerId=2,CustomerName="B"}
                };

            customers.ForEach(c => context.Customers.Add(c));

            context.SaveChanges();
        }
    }
}